/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.webaccess.retailws.Delegate;

import com.webaccess.retailws.Bean.PaymentBean;
import com.webaccess.retailws.Bean.ProductBean;
import com.webaccess.retailws.DAO.ProductDAO;
import java.sql.ResultSet;
import java.util.LinkedHashMap;

/**
 *
 * @author Owner
 */
public class ProductDelegate {

    ProductDAO prodDAO = null;

    public ProductDelegate() {
        prodDAO = new ProductDAO();
    }

    public ProductBean[] getAllProducts() {
        return prodDAO.getAllProducts();
    }

    public ProductBean getProduct(Long productId) {
        return prodDAO.getProduct(productId);
    }

    public boolean saveProduct(ProductBean prodBean) {
        return prodDAO.saveProduct(prodBean);
    }

    public boolean deleteProduct(Long productId) {
        return prodDAO.deleteProduct(productId);
    }

    public ProductBean[] searchProductByPhrase(String product) {
        return prodDAO.searchProduct(product, "", 0L, 0L, 0L);
    }

    public ProductBean[] searchProductByName(String productName) {
        return prodDAO.searchProduct("", productName, 0L, 0L, 0L);
    }

    public ProductBean[] searchProductByStatus(Long productStatusId) {
        return prodDAO.searchProduct("", "", productStatusId, 0L, 0L);
    }

    public ProductBean[] searchProductByCategory(Long productCategoryId) {
        return prodDAO.searchProduct("", "", 0L, productCategoryId, 0L);
    }

    public ProductBean[] searchProductByBrand(Long productBrandId) {
        return prodDAO.searchProduct("", "", 0L, 0L, productBrandId);
    }

    public ProductBean[] getProductByCategory(Long categoryId) {
        return prodDAO.getProductByCategory(categoryId);
    }

    public ProductBean[] getProductBySubCategory(Long subCategoryId) {
        return prodDAO.getProductByCategory(subCategoryId);
    }

    public ProductBean[] getProductByBrand(Long brandId) {
        return prodDAO.searchProduct("", "", 0L, 0L, brandId);
    }

    public ProductBean[] getProductByPrice(Long min, Long max) {
        return prodDAO.getProductByPrice(min, max);
    }

    public ProductBean[] getAllCartProduct(Long cartId) {
        return prodDAO.getAllCartProduct(cartId);
    }

    public ProductBean addToCart(ProductBean prodBean, Long userId) {
        return prodDAO.addToCart(prodBean, userId);
    }

    public Long getCartId(Long userId, Long orderId) {
        return prodDAO.getCartId(userId,orderId);
    }

    public boolean removeProductFromCart(Long cartProductId, Long cartId, Long cartCost) {
        return prodDAO.removeProductFromCart(cartProductId, cartId, cartCost);
    }

    public boolean clearCart(Long cartId) {
        return prodDAO.clearCart(cartId);
    }

    public ProductBean[] getSearchProducts(Long categoryId, String searchProduct) {
        return prodDAO.getSearchProducts(categoryId, searchProduct);
    }

    public LinkedHashMap getProductByCategoryLHMap(Long categoryId) {
        return prodDAO.getProductByCategoryLHMap(categoryId);
    }

    public ProductBean getCartProduct(Long cartProductId) {
        return prodDAO.getCartProduct(cartProductId);
    }

    public boolean updateCartProduct(ProductBean prodBean) {
        return prodDAO.updateCartProduct(prodBean);
    }
}
